.class public Lcom/estrongs/android/icon/loader/b;
.super Lcom/nostra13/universalimageloader/core/download/a;
.source "ESImageDownloader.java"


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 0

    .line 1
    invoke-direct {p0, p1}, Lcom/nostra13/universalimageloader/core/download/a;-><init>(Landroid/content/Context;)V

    return-void
.end method

.method private static a(Lcom/estrongs/fs/g;)Landroid/graphics/drawable/Drawable;
    .locals 1

    .line 11
    invoke-static {}, Lcom/estrongs/android/pop/l;->L1()Lcom/estrongs/android/pop/l;

    move-result-object v0

    invoke-virtual {v0}, Lcom/estrongs/android/pop/l;->r1()Z

    move-result v0

    if-nez v0, :cond_1

    .line 12
    invoke-static {p0}, Les/rj;->j(Lcom/estrongs/fs/g;)Z

    move-result v0

    if-nez v0, :cond_1

    invoke-static {p0}, Les/rj;->i(Lcom/estrongs/fs/g;)Z

    move-result v0

    if-eqz v0, :cond_0

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    goto :goto_1

    :cond_1
    :goto_0
    const/4 v0, 0x1

    :goto_1
    if-nez v0, :cond_2

    .line 13
    invoke-static {p0}, Les/rj;->c(Lcom/estrongs/fs/g;)Landroid/graphics/drawable/Drawable;

    move-result-object p0

    return-object p0

    .line 14
    :cond_2
    invoke-interface {p0}, Lcom/estrongs/fs/g;->i()Lcom/estrongs/fs/l;

    move-result-object v0

    invoke-virtual {v0}, Lcom/estrongs/fs/l;->b()Z

    move-result v0

    if-eqz v0, :cond_4

    .line 15
    invoke-interface {p0}, Lcom/estrongs/fs/g;->d()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/estrongs/android/util/h0;->U1(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_3

    const-string v0, "device_name"

    .line 16
    invoke-interface {p0, v0}, Lcom/estrongs/fs/g;->a(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-static {v0}, Les/qj;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_3

    .line 17
    invoke-static {}, Lcom/estrongs/android/ui/theme/b;->r()Lcom/estrongs/android/ui/theme/b;

    move-result-object p0

    invoke-virtual {p0, v0}, Lcom/estrongs/android/ui/theme/b;->b(Ljava/lang/String;)Landroid/graphics/drawable/Drawable;

    move-result-object p0

    return-object p0

    .line 18
    :cond_3
    invoke-static {p0}, Les/rj;->c(Lcom/estrongs/fs/g;)Landroid/graphics/drawable/Drawable;

    move-result-object p0

    return-object p0

    :cond_4
    const/4 p0, 0x0

    return-object p0
.end method

.method private static a(Landroid/graphics/drawable/Drawable;)Ljava/io/InputStream;
    .locals 6
    .param p0    # Landroid/graphics/drawable/Drawable;
        .annotation build Landroidx/annotation/Nullable;
        .end annotation
    .end param

    const/4 v0, 0x0

    if-nez p0, :cond_0

    return-object v0

    .line 1
    :cond_0
    :try_start_0
    invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I

    move-result v1

    invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I

    move-result v2

    .line 2
    invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getOpacity()I

    move-result v3

    const/4 v4, -0x1

    if-eq v3, v4, :cond_1

    sget-object v3, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    goto :goto_0

    :cond_1
    sget-object v3, Landroid/graphics/Bitmap$Config;->RGB_565:Landroid/graphics/Bitmap$Config;

    .line 3
    :goto_0
    invoke-static {v1, v2, v3}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v1

    .line 4
    new-instance v2, Landroid/graphics/Canvas;

    invoke-direct {v2, v1}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    .line 5
    invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I

    move-result v3

    invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I

    move-result v4

    const/4 v5, 0x0

    invoke-virtual {p0, v5, v5, v3, v4}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    .line 6
    invoke-virtual {p0, v2}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    .line 7
    new-instance p0, Ljava/io/ByteArrayOutputStream;

    invoke-direct {p0}, Ljava/io/ByteArrayOutputStream;-><init>()V

    .line 8
    sget-object v2, Landroid/graphics/Bitmap$CompressFormat;->PNG:Landroid/graphics/Bitmap$CompressFormat;

    const/16 v3, 0x64

    invoke-virtual {v1, v2, v3, p0}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z

    .line 9
    new-instance v1, Ljava/io/ByteArrayInputStream;

    invoke-virtual {p0}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object p0

    invoke-direct {v1, p0}, Ljava/io/ByteArrayInputStream;-><init>([B)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    return-object v1

    :catch_0
    move-exception p0

    .line 10
    invoke-virtual {p0}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object p0

    invoke-static {p0}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;)V

    return-object v0
.end method

.method private static a(Ljava/lang/String;)Ljava/io/InputStream;
    .locals 2

    const/16 v0, 0xa

    .line 19
    :try_start_0
    invoke-virtual {p0, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object p0

    .line 20
    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object v0

    invoke-virtual {v0}, Landroid/app/Application;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v0

    const/4 v1, 0x0

    .line 21
    invoke-virtual {v0, p0, v1}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;

    move-result-object p0

    .line 22
    iget-object p0, p0, Landroid/content/pm/PackageInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    invoke-virtual {v0, p0}, Landroid/content/pm/PackageManager;->getApplicationIcon(Landroid/content/pm/ApplicationInfo;)Landroid/graphics/drawable/Drawable;

    move-result-object p0

    invoke-static {p0}, Lcom/estrongs/android/icon/loader/b;->a(Landroid/graphics/drawable/Drawable;)Ljava/io/InputStream;

    move-result-object p0
    :try_end_0
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    return-object p0

    :catch_0
    const/4 p0, 0x0

    return-object p0
.end method


# virtual methods
.method protected d(Ljava/lang/String;Ljava/lang/Object;)Ljava/io/InputStream;
    .locals 2

    .line 1
    instance-of v0, p2, Lcom/estrongs/fs/g;

    if-eqz v0, :cond_0

    .line 2
    move-object v0, p2

    check-cast v0, Lcom/estrongs/fs/g;

    .line 3
    invoke-static {v0}, Les/rj;->c(Lcom/estrongs/fs/g;)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    if-nez v0, :cond_1

    .line 4
    sget-object v0, Lcom/nostra13/universalimageloader/core/download/ImageDownloader$Scheme;->DRAWABLE:Lcom/nostra13/universalimageloader/core/download/ImageDownloader$Scheme;

    invoke-virtual {v0, p1}, Lcom/nostra13/universalimageloader/core/download/ImageDownloader$Scheme;->crop(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 5
    invoke-static {v0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    .line 6
    invoke-static {}, Lcom/estrongs/android/ui/theme/b;->r()Lcom/estrongs/android/ui/theme/b;

    move-result-object v1

    invoke-virtual {v1, v0}, Lcom/estrongs/android/ui/theme/b;->c(I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    :cond_1
    if-eqz v0, :cond_2

    .line 7
    invoke-static {v0}, Lcom/estrongs/android/icon/loader/b;->a(Landroid/graphics/drawable/Drawable;)Ljava/io/InputStream;

    move-result-object p1

    return-object p1

    .line 8
    :cond_2
    invoke-super {p0, p1, p2}, Lcom/nostra13/universalimageloader/core/download/a;->d(Ljava/lang/String;Ljava/lang/Object;)Ljava/io/InputStream;

    move-result-object p1

    return-object p1
.end method

.method protected e(Ljava/lang/String;Ljava/lang/Object;)Ljava/io/InputStream;
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    instance-of v0, p2, Lcom/estrongs/fs/g;

    if-nez v0, :cond_0

    .line 2
    invoke-super {p0, p1, p2}, Lcom/nostra13/universalimageloader/core/download/a;->e(Ljava/lang/String;Ljava/lang/Object;)Ljava/io/InputStream;

    move-result-object p1

    return-object p1

    .line 3
    :cond_0
    check-cast p2, Lcom/estrongs/fs/g;

    .line 4
    invoke-interface {p2}, Lcom/estrongs/fs/g;->i()Lcom/estrongs/fs/l;

    move-result-object v0

    invoke-virtual {v0}, Lcom/estrongs/fs/l;->b()Z

    move-result v0

    if-eqz v0, :cond_2

    .line 5
    invoke-interface {p2}, Lcom/estrongs/fs/g;->getPath()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/estrongs/android/util/h0;->i2(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_1

    invoke-interface {p2}, Lcom/estrongs/fs/g;->getPath()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/estrongs/android/util/h0;->v1(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_2

    .line 6
    :cond_1
    invoke-static {}, Les/rj;->d()Z

    move-result v0

    if-eqz v0, :cond_2

    const/4 v0, 0x0

    .line 7
    invoke-static {p2, v0}, Lcom/estrongs/android/view/ImageFileGridViewWrapper;->a(Lcom/estrongs/fs/g;Z)Lcom/estrongs/fs/g;

    move-result-object p2

    .line 8
    :cond_2
    invoke-static {p2}, Lcom/estrongs/android/icon/loader/b;->a(Lcom/estrongs/fs/g;)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    if-eqz v0, :cond_3

    .line 9
    invoke-static {v0}, Lcom/estrongs/android/icon/loader/b;->a(Landroid/graphics/drawable/Drawable;)Ljava/io/InputStream;

    move-result-object p1

    return-object p1

    .line 10
    :cond_3
    invoke-interface {p2}, Lcom/estrongs/fs/g;->d()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/estrongs/android/util/n0;->z(Ljava/lang/String;)Z

    move-result v0

    const/4 v1, 0x0

    if-eqz v0, :cond_4

    .line 11
    invoke-static {}, Les/rj;->d()Z

    move-result v2

    if-eqz v2, :cond_4

    .line 12
    invoke-interface {p2}, Lcom/estrongs/fs/g;->d()Ljava/lang/String;

    move-result-object v2

    .line 13
    new-instance v3, Ljava/io/File;

    invoke-direct {v3, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 14
    invoke-virtual {v3}, Ljava/io/File;->exists()Z

    move-result v3

    if-eqz v3, :cond_4

    .line 15
    sget-object v3, Lcom/nostra13/universalimageloader/core/download/ImageDownloader$Scheme;->FILE:Lcom/nostra13/universalimageloader/core/download/ImageDownloader$Scheme;

    invoke-virtual {v3, v2}, Lcom/nostra13/universalimageloader/core/download/ImageDownloader$Scheme;->wrap(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-super {p0, v2, v1}, Lcom/nostra13/universalimageloader/core/download/a;->e(Ljava/lang/String;Ljava/lang/Object;)Ljava/io/InputStream;

    move-result-object v2

    if-eqz v2, :cond_4

    return-object v2

    .line 16
    :cond_4
    invoke-static {p2}, Lcom/estrongs/android/util/n0;->a(Lcom/estrongs/fs/g;)I

    move-result v2

    .line 17
    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object v3

    invoke-static {v3}, Les/rj;->a(Landroid/content/Context;)Les/rj;

    move-result-object v3

    invoke-virtual {v3}, Les/rj;->a()Ljava/util/HashMap;

    move-result-object v3

    .line 18
    invoke-static {v2}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v3, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Les/uj;

    if-eqz v2, :cond_6

    .line 19
    invoke-static {}, Les/rj;->d()Z

    move-result v3

    if-eqz v3, :cond_6

    .line 20
    invoke-interface {v2, p2}, Les/uj;->b(Lcom/estrongs/fs/g;)Landroid/graphics/drawable/Drawable;

    move-result-object v3

    if-nez v3, :cond_5

    .line 21
    instance-of v2, v2, Les/oj;

    if-nez v2, :cond_5

    .line 22
    invoke-static {p2}, Les/rj;->c(Lcom/estrongs/fs/g;)Landroid/graphics/drawable/Drawable;

    move-result-object v3

    :cond_5
    if-eqz v3, :cond_6

    .line 23
    invoke-static {v3}, Lcom/estrongs/android/icon/loader/b;->a(Landroid/graphics/drawable/Drawable;)Ljava/io/InputStream;

    move-result-object p1

    return-object p1

    :cond_6
    if-eqz v0, :cond_7

    .line 24
    invoke-static {}, Les/rj;->d()Z

    move-result v0

    if-eqz v0, :cond_7

    .line 25
    invoke-super {p0, p1, v1}, Lcom/nostra13/universalimageloader/core/download/a;->e(Ljava/lang/String;Ljava/lang/Object;)Ljava/io/InputStream;

    move-result-object p1

    return-object p1

    .line 26
    :cond_7
    invoke-static {p2}, Les/rj;->c(Lcom/estrongs/fs/g;)Landroid/graphics/drawable/Drawable;

    move-result-object p1

    if-nez p1, :cond_8

    .line 27
    invoke-static {}, Lcom/estrongs/android/ui/theme/b;->r()Lcom/estrongs/android/ui/theme/b;

    move-result-object p1

    const p2, 0x7f0803e7

    invoke-virtual {p1, p2}, Lcom/estrongs/android/ui/theme/b;->c(I)Landroid/graphics/drawable/Drawable;

    move-result-object p1

    .line 28
    :cond_8
    invoke-static {p1}, Lcom/estrongs/android/icon/loader/b;->a(Landroid/graphics/drawable/Drawable;)Ljava/io/InputStream;

    move-result-object p1

    return-object p1
.end method

.method protected g(Ljava/lang/String;Ljava/lang/Object;)Ljava/io/InputStream;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    if-eqz p1, :cond_0

    const-string v0, "appIcon://"

    .line 1
    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 2
    invoke-static {p1}, Lcom/estrongs/android/icon/loader/b;->a(Ljava/lang/String;)Ljava/io/InputStream;

    move-result-object p1

    return-object p1

    .line 3
    :cond_0
    invoke-super {p0, p1, p2}, Lcom/nostra13/universalimageloader/core/download/a;->g(Ljava/lang/String;Ljava/lang/Object;)Ljava/io/InputStream;

    const/4 p1, 0x0

    throw p1
.end method
